package org.example.service.Impl;

import org.example.dao.entity.db1.User;
import org.example.dao.mapper.db1.UserMapper;
import org.example.common.dto.UserInfoDto;
import org.example.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("userService")
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;

    @Override
    public UserInfoDto getUserById(Integer id) {
        User userModel = userMapper.getUserById(id);
        UserInfoDto userInfoDto = new UserInfoDto();
        userInfoDto.setUsername(userModel.getUsername());
        userInfoDto.setPassword(userModel.getPassword());
        return userInfoDto;
    }
}
